|
In computational complexity theory, Savitch's theorem, proved by Walter Savitch in 1970, gives a relationship between deterministic and non-deterministic space complexity. It states that for any function , : In other words, if a nondeterministic Turing machine can solve a problem using ''f''(''n'') space, an ordinary deterministic Turing machine can solve the same problem in the square of that space bound.〔Arora & Barak (2009) p.86〕 Although it seems that nondeterminism may produce exponential gains in time, this theorem shows that it has a markedly more limited effect on space requirements.〔Arora & Barak (2009) p.92〕 == Proof == There is a proof of the theorem that is constructive: it demonstrates an algorithm for STCON, the problem of determining whether there is a path between two vertices in a directed graph, which runs in space for ''n'' vertices. The basic idea of the algorithm is to solve recursively a somewhat more general problem, testing the existence of a path from a vertex ''s'' to another vertex ''t'' that uses at most ''k'' edges, where ''k'' is a parameter that is given as input to the recursive algorithm; STCON may be solved from this problem by setting ''k'' to ''n''. To test for a ''k''-edge path from ''s'' to ''t'', one may test whether each vertex ''u'' may be the midpoint of the path, by recursively searching for paths of half the length from ''s'' to ''u'' and ''u'' to ''t''. Using pseudocode (with syntax closely resembling Python) we can express this algorithm as follows: This search calls itself to a recursion depth of O(log ''n'') levels, each of which requires O(log ''n'') bits to store the function arguments and local variables at that level, so the total space used by the algorithm is . Although described above in the form of a program in a high-level language, the same algorithm may be implemented with the same asymptotic space bound on a Turing machine. The reason why this algorithm implies the theorem is that any language corresponds to a directed graph whose vertices are the configurations of a Turing machine deciding membership in . For each , this graph has a path from the starting configuration on input to the accepting configuration if and only if . Thus deciding connectivity is sufficient to decide membership in , and by the above algorithm this can be done in . 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Savitch's theorem」の詳細全文を読む スポンサード リンク
|